PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

Tasks and Address Spaces

On the Mac OS, all applications are assigned a process or application context at runtime. The process contains all the resources required by the application, such as allocated memory, stack space, plug-ins, nonglobal data, and so on. Tasks created with Multiprocessing Services are automatically associated with the creating application's process, as shown in Figure 2-1 .

Figure 2-1   Tasks within processes

All resources within a process occupy the same address space, so tasks created by the same application are free to share memory. For example, if you want to divide an image filtering operation among multiple identical tasks, you can allocate space for the entire image in memory, and then assign each task the address and length of the portion it should process.

IMPORTANT

Although all processes share the same address space in Mac OS 8.6, you should not assume that this will remain the case; your application or task should not attempt to access data or code residing in another process.


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)